<?php

Yii::import('common.models.db.ShopCategoryModel');

class FrontendShopCategoryModel extends ShopCategoryModel
{
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	public static function getCategory($parentId=0)
	{
		$sql = "SELECT * FROM shop_category WHERE published=1 AND parent_id=:pid ORDER BY position ASC";
		$command = Yii::app()->db->createCommand($sql);
		$command->bindParam(':pid', $parentId, PDO::PARAM_INT);
		return $command->queryAll();
	}
}